package com.mygy.fitnesshelper;

import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView;

import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewOutlineProvider;
import android.widget.ImageButton;
import android.widget.LinearLayout;

import com.mygy.fitnesshelper.adapters.exercises.TrainingProgramRecyclerAdapter;
import com.mygy.fitnesshelper.data.User;
import com.mygy.fitnesshelper.data.exercises.TrainingProgramm;

import eightbitlab.com.blurview.BlurView;
import eightbitlab.com.blurview.RenderScriptBlur;

public class ProgramsAcivity extends AppCompatActivity {

    public static User user;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_programs_acivity);

        /////
        LinearLayout linearlayout = findViewById(R.id.mainTraining);

        AnimationDrawable animationDrawable = (AnimationDrawable) linearlayout.getBackground();
        animationDrawable.setEnterFadeDuration(100);
        animationDrawable.setExitFadeDuration(5000);
        animationDrawable.start();
        ///


        ImageButton backBtn = findViewById(R.id.programs_back);
        backBtn.setOnClickListener(v -> {
            finish();
        });

        RecyclerView recyclerView = findViewById(R.id.trainingPtogramsLib_recycler);
        TrainingProgramRecyclerAdapter adapter = new TrainingProgramRecyclerAdapter(this, TrainingProgramm.getAllPrograms());
        recyclerView.setAdapter(adapter);
    }
}